<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<form>
			<label>书籍名称：</label><input type="text" placeholder="请输入书籍名" name="shu" id="shu" /><br />
			<label>出版日期：</label><input type="date" placeholder="请输入出版日期" name="time" id="time" /><br />
			<label>价 &nbsp;&nbsp;&nbsp;&nbsp; 格：</label><input type="text" placeholder="请输入书籍价格" name="price" id="price" /><br />
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="yes" onclick="add()">保存</button><br />
		</form>
		<script>
			let arrshuji=JSON.parse(sessionStorage.getItem("arrshuji"));
			console.log(arrshuji);
			let shu=document.getElementsByName("shu")[0];
			let time=document.getElementsByName("time")[0];
			let price=document.getElementsByName("price")[0];
			let item=sessionStorage.getItem("item");
			if (item) {
				shu.value=item.minzi;
				tiem.value=item.riqi;
				price.value=item.jiage;
			}
			function add(){
				 shu=shu.value;
				 time=time.value;
				 price=price.value;
				arrshuji.push({minzi:shu,riqi:time,jiage:price},);
				console.log(arrshuji);
				sessionStorage.setItem("arrshuji",JSON.stringify(arrshuji));
				window.open("作业一页面.html");
				
			}
		</script>
	</body>
</html>
